package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementQosFlowMapper;
import com.ruoyi.net.domain.ElementQosFlow;
import com.ruoyi.net.service.IElementQosFlowService;

/**
 * 网元-QOS配置-流分类Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementQosFlowServiceImpl implements IElementQosFlowService 
{
    @Autowired
    private ElementQosFlowMapper elementQosFlowMapper;

    /**
     * 查询网元-QOS配置-流分类
     * 
     * @param id 网元-QOS配置-流分类主键
     * @return 网元-QOS配置-流分类
     */
    @Override
    public ElementQosFlow selectElementQosFlowById(String id)
    {
        return elementQosFlowMapper.selectElementQosFlowById(id);
    }

    /**
     * 查询网元-QOS配置-流分类列表
     * 
     * @param elementQosFlow 网元-QOS配置-流分类
     * @return 网元-QOS配置-流分类
     */
    @Override
    public List<ElementQosFlow> selectElementQosFlowList(ElementQosFlow elementQosFlow)
    {
        return elementQosFlowMapper.selectElementQosFlowList(elementQosFlow);
    }

    /**
     * 新增网元-QOS配置-流分类
     * 
     * @param elementQosFlow 网元-QOS配置-流分类
     * @return 结果
     */
    @Override
    public int insertElementQosFlow(ElementQosFlow elementQosFlow)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementQosFlow.getId())) {
            elementQosFlow.setId(uuid);
        }
        elementQosFlow.setCreateBy(SecurityUtils.getUsername());
        elementQosFlow.setCreateTime(DateUtils.getNowDate());
        elementQosFlow.setUpdateBy(SecurityUtils.getUsername());
        elementQosFlow.setUpdateTime(DateUtils.getNowDate());
        return elementQosFlowMapper.insertElementQosFlow(elementQosFlow);
    }

    /**
     * 修改网元-QOS配置-流分类
     * 
     * @param elementQosFlow 网元-QOS配置-流分类
     * @return 结果
     */
    @Override
    public int updateElementQosFlow(ElementQosFlow elementQosFlow)
    {
        elementQosFlow.setUpdateBy(SecurityUtils.getUsername());
        elementQosFlow.setUpdateTime(DateUtils.getNowDate());
        return elementQosFlowMapper.updateElementQosFlow(elementQosFlow);
    }

    /**
     * 批量删除网元-QOS配置-流分类
     * 
     * @param ids 需要删除的网元-QOS配置-流分类主键
     * @return 结果
     */
    @Override
    public int deleteElementQosFlowByIds(String[] ids)
    {
        return elementQosFlowMapper.deleteElementQosFlowByIds(ids);
    }

    /**
     * 删除网元-QOS配置-流分类信息
     * 
     * @param id 网元-QOS配置-流分类主键
     * @return 结果
     */
    @Override
    public int deleteElementQosFlowById(String id)
    {
        return elementQosFlowMapper.deleteElementQosFlowById(id);
    }
}
